<template>
  <div @drop="drop" @dragover="dragover">
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    defaultData: {
      type: Object,
      required: false,
    },
  },
  methods: {
    drop(ev) {
      ev.preventDefault();
      this.$emit("comDrop", {
        data: JSON.parse(ev.dataTransfer.getData("data")),
        domId: ev.dataTransfer.getData("domId"),
        defaultData: this.defaultData,
      });
    },
    dragover(ev) {
      ev.preventDefault();
    },
  },
};
</script>

<style></style>
